const app = getApp()
Page({
  data: {
    markers: [{
      iconPath: "/img/position.png",
      id: 0,
      latitude: '',
      longitude: '',
      width: 50,
      height: 50
    }],
  },
  onLoad(option){
    
    var that = this;
    wx.request({
      url: app.globalData.evaluateurl + 'apint/bill/selectLonLat',
      header: {
        'content-type': 'application/x-www-form-urlencoded',
      },
      method: 'post',
      data: {
        vehicleno: option.vehicleno
      },
      success: function (res) {
        if (res.statusCode == '200') {
          that.setData({
            'markers[0].latitude' : res.data[0].lat,
            'markers[0].longitude' : res.data[0].lon
          })
        }
      },
      fail: function (res) {

      }
    })
  },
  regionchange(e) {
    console.log(e.type)
    
  },
  markertap(e) {
    console.log(e.markerId)
  },
  controltap(e) {
    console.log(e.controlId)
  }
})